package com.huhu.service.impl;

import com.huhu.entity.UserInfo;
import com.huhu.mapper.UserMapper;
import com.huhu.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public int addUser(UserInfo userInfo) {
        return userMapper.addUser(userInfo);
    }

    @Override
    public UserInfo getUserByUsername(String username) {
        return userMapper.getUserByUsername(username);
    }

    @Override
    public int updatePhoto(Long uid, String imgUrl) {
        return userMapper.updatePhoto(uid,imgUrl);
    }

    @Override
    public UserInfo getUserById(Long uid) {
        return userMapper.getUserById(uid);
    }

    @Override
    public boolean updateUser(UserInfo userInfo) {
        return userMapper.updateUser(userInfo);
    }
}
